home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tiger Disk 118
/
Tiger_Disk_118_20xx_Tiger-Crew-Disk_de_Side_B.d64
/
vier gewinnt
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
5KB
|
170 lines
100 rem vier gewinnt
110 poke 53280,0: poke 53281,0
115 dim x$(42),y$(69),a(7),b(69)
120 print "[147]": rem graphik
122 for i=55456 to 56295: poke i,11:next
124 for i=0 to 760 step 40: for j=0 to 27: poke 1144+i+j,160: nextj: nexti
126 u=1944: g=160: poke u,g: poke u+1,g: poke u+2,g: poke u+3,g: poke u+27,g
128 poke u+26,g: poke u+25,g: pokeu+24,g
130 for k=0 to 600 step 120
140 for i=0 to 24 step 4: j=1185+i+k: h=55457+i+k
145 poke h,12: poke h+1,12: poke h+40,12 : poke h+41,12
150 poke j,79: poke j+1,80: poke j+40, 76: poke j+41,122
160 next i: next k
190 e=1065: f=1185: g=1219: q=54272
200 for i=1 to 42: read x$(i): next i: restore
205 gosub 2000: if re=1 goto 2050
210 print "";tab(7)"vier gewinnt [157][157][157][157]"
220 print "[129]der stein wird durch die spa [157][157][157][157]ce-"
230 print "[129]taste in position gebracht."
240 print "[129]er faellt nach druecken von [157][157][157][157]return."
250 for i=1 to 42: b=1
260 z=val(mid$(x$(i),b,2))
270 if z=0 then 310
280 if len(y$(z))=6 then y$(z)=y$(z)+ right$(str$(i),2): goto 300
290 y$(z)=right$(str$(i),2)+y$(z)
300 b=b+2: goto 260
310 next i
320 for i=1031 to 1183: poke i,32: nexti
322 for i=55416 to 55446: poke i,11:next
324 for i=1144 to1171: poke i,160: next
325 for i=55296 to 55415: poke i,13: next i
327 poke 55491,9: poke 55492,9
330 ss=2
370 a=e: b=1: z=z+1
380 poke 55491,15: poke 55492,15
385 poke g,asc(right$(str$(z),2))
390 poke g+1,asc(right$(str$(z),1))
400 if z>41 then print "[158]unentschieden ": poke g+1,50: goto 650
410 gosub 1350: poke v,32: poke v+1,58: poke v+39,b%: d=5
430 get a$: if a$<>"" then 430
440 get a$: if a$=" " then gosub 1370
450 if a$="e" then 650
460 if a$<>chr$(13) then 440
470 if peek(a+120)<>79 then 440
480 a=a+120: ii=peek (v+1): for i=ii to ii+24: poke v+1,i: next i
490 if peek (a+120)<> 79 then 510
500 d=d-1: goto 480
510 poke a+q,b%: poke a+1+q,b%: poke a+40+q,b%: poke a+41+q,b%
520 poke a+1,160: poke a+40,160: poke a+41,160: poke a,160
530 a=7*d+b: b=1: r=1: if b%=14 then r=-1
540 d=val(mid$(x$(a),b,2))
550 if d=0 then 700
560 b(d)=b(d)+r: if b(d)^2=16 then 580
570 b=b+2: goto 540
580 b$="[158]spieler": if b%=14 then b$="[158]c [157][157][157][157]omputer"
590 print "";b$;" gewinnt"
600 poke v,0: for r=1 to 7 step 2
610 b=val(mid$(y$(d),r,2))/7
620 t=120*(6-int(b-.1)): s=(b-int(b-.1)) *28-4
630 poke e+s+t,79: poke e+s+t+41,122
640 next r
650 print "[158]neues spiel (j/n) ?"
660 get a$: if a$<>"" then 660
670 get a$: if a$="j" then 1220
680 if a$="n" then end
690 goto 670
700 if b%=14 then 370
710 poke g,asc(right$(str$(z),2))
720 poke g+1,asc(right$(str$(z),1))
730 poke v+39,14: poke v,32
740 poke v+1,58
750 if z<2 then s=12: goto 1280
760 for i=1 to 69: if b(i)>-3 then 820
770 for k=1 to 8 step 2: a=val(mid$ (y$(i),k,2))/7
780 t=120*(6-int(a-.1)): s=(a-int(a-.1)) *28-4
790 s=int(s+.5)
800 if peek(e+t+s)<>79 then next k
810 if peek(f+t+s)<>79 then 1280
820 next i: for i=1 to 69: if b(i)<3 then 880
830 for k=1 to 8 step 2: a=val(mid$ (y$(i),k,2))/7
840 t=120*(6-int(a-.1)): s=(a-int(a-.1)) *28-4
850 s=int(s+.5)
860 if peek(e+t+s)<>79 then next k
870 if peek(f+t+s)<>79 then 1280
880 next i: for m=ss to 2: for i=69 to 1 step -1: if b(i)<>2 then 980
890 for k=1 to 10 step 2: a=val(mid$ (y$(i),k,2)): if a=0 then 980
900 t=120*(6-int(a/7-.1)): s=(a-int(a/7 -.1)*7)*4-4
910 if peek(e+t+s)<>79 then next k
920 if peek(f+t+s)=79 then next k
930 a=(7-t/120)*7+s/4+1: j=1: if a>42 then 1280
940 l=val(mid$(x$(a),j,2))
950 if l=0 then 1280
960 if b(l)>m or b(l)<-m then next k: goto 980
970 j=j+2: goto 940
980 next i: next m
990 for m=ss to 2: for i0=1 to 13
1000 s=int(rnd(1)*6)*4
1010 if peek(f+s)>79 then 1100
1015 t=-120
1020 t=t+120
1030 if peek(f+t+s)=79 and t<600 then 1020
1040 if t=120 then 1280
1050 a=(6-(t-120)/120)*7+s/4+1: j=1
1060 k=val(mid$(x$(a),j,2))
1070 if k=0 then 1280
1080 if b(k)>m or b(k)<-m then 1100
1090 j=j+2: goto 1060
1100 next i0
1105 next m
1110 for s=0 to 26 step 4
1120 if peek(f+s)>79 then 1210
1130 for t=0 to 600 step 120
1140 if peek(f+t+s)=79 then next t
1150 if t=120 then 1280
1160 a=(6-(t-120)/120)*7+s/4+1: j=1
1170 k=val(mid$(x$(a),j,2))
1180 if k=0 then 1280
1190 if b(k)=3 then 1210
1200 j=j+2: goto 1170
1210 next s: print "[158]computer gibt auf. ": poke v,0: goto 650
1220 print "[147]": poke v,0: b%=14: re=1: z=0: goto 120
1230 re=0: b%=14: goto 370
1280 a=e: b=1: z=z+1: d=5
1290 poke g,asc(right$(str$(z),2))
1300 poke g+1,asc(right$(str$(z),1))
1310 r=0: gosub 1350: if s=0 then 480
1320 r=r+1: gosub 1370
1330 if r=>s/4 then 480
1340 goto 1320
1350 if b%=8 then b%=14: return
1360 b%=8: return
1370 b=b+1: a=a+4: ii=peek(v): if b>7 then b=1: a=e: goto 1390
1380 for i=ii to ii+32: poke v,i: next i : return
1390 for i=ii to 32 step -1: poke v,i: next i: return
1420 rem computerstrategie
1430 data "01254900","0102285200"
1440 data "010203315500","0102030434575800"
1450 data "020304375900","0304406100"
1460 data "04436400","0525264700"
1470 data "05062829495000"
1480 data "050607313252535800"
1490 data "0506070834355556596000"
1500 data "060708373861625700"
1510 data "07084041646500","0843446700"
1520 data "092526274600"
1530 data "091028293047485800"
1540 data "091011313233495051596000"
1550 data "0910111234353652535461626300"
1560 data "101112373839646566555600"
1570 data "111240414267685700"
1580 data "124344456900","132526275800"
1590 data "131428293059604600"
1600 data "131415313233616263474800"
1610 data "1314151634353664656649505100"
1620 data "141516373839676852535400"
1630 data "151640414269555600"
1640 data "164344455700","2627176000"
1650 data "17182930626300"
1660 data "171819323365664600"
1670 data "1718192035364748686700"
1680 data "181920383950516900"
1690 data "19204142535400","2044455600"
1700 data "27216300","2122306600"
1710 data "212223336800","2122232436694600"
1720 data "222324394800","2324425100"
1730 data "24455400"
2000 v=53248: poke v+21,1:poke 2040,11: for i=0to45 step 3: poke 704+i,255
2010 poke 705+i,255: next i: poke v+27, 1: return
2050 for i=0 to 69: b(i)=0: next i: goto 320